import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.PrintWriter;

import junit.framework.Assert;

import org.weso.lodin.appserv.ScoreAppServ;
import org.weso.lodin.appserv.TransformerAppServ;
import org.weso.lodin.dao.CountryDAO;
import org.weso.lodin.dao.CountryDAOImpl;
import org.weso.lodin.dao.ScoreDAOImpl;


public class ScoreAppServMain {

	public static void main(String []args) throws FileNotFoundException{
		ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
		InputStream inCountries = contextClassLoader.getResourceAsStream(
				TransformerAppServ.COUNTRIES_COUNTRIES_FAO_XLS);
		CountryDAO daoCountries = new CountryDAOImpl(inCountries);
		ScoreDAOImpl dao = new ScoreDAOImpl(Thread.currentThread().getContextClassLoader().getResourceAsStream("excel/webindex_data_scores.xls"));
		ScoreAppServ appServ = new ScoreAppServ(daoCountries);
		PrintWriter pw = new PrintWriter(new File("generated/scores.ttl"));
		//System.out.println(appServ.generateModel(dao.extractObservationsByDataset("WebIndex"),pw,1));
		//System.out.println(appServ.generateModel(dao.extractObservationsByDataset("Zscores"),pw,184));
		appServ.generateModel(dao.extractObservationsByDataset("Indicators"),pw,855);
	}
}
